<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Shop Management System</title>
<style type="text/css">
#feedback {
	font-size: 1.4em;
}

#selectable .ui-selecting {
	background: #fff;
}

#selectable .ui-selected {
	background: #fff;
	color: red;
}

#selectable {
	list-style-type: none;
	margin: 0;
	padding: 0;
}

#selectable li {
	margin: 1px;
	border: 1px dotted #CCCCCC;
	padding-bottom: 5px;
	float: left;
	width: 275px;
	height: 90px;
	line-height: 60px;
	font-size: 20px;
	text-align: center;
}

#selectable .ui-state-default {
	background: #fff;
}

.barcode{
	width: 840px;
}

@media print {
	input {
		display: none;
	}
	
	.noprint {
		display: none;
	}
}
</style>
</head>
<body>

<div class="barcode">
<div class="noprint" style="padding: 30px; text-align: center; "><input type="button" name="endsale" id="endsale" value="พิมพ์บาร์โค้ด" onclick="javascript:window.print();" > <input type="button" name="btnClose" value="ปิดหน้าต่าง" onclick="JavaScript:window.close();" /></div>
<ol id="selectable">
<?php 
include("../connect/connect.php");

if($_POST['select']=='all'){
	$Query = mysql_query("SELECT code FROM product ORDER BY code");


while($Row = mysql_fetch_array($Query)){
?>

<li class="ui-state-default"><img src="../function/barcode.php?barcode=<?php echo $Row['code'].'&width=275&height=80';?>" /></li>
<?php 
	}
} 

if($_POST['select']=='listname'){
	$qty = $_POST['qty'];
	for($i=1;$i<=$qty;$i++){
?>
<li class="ui-state-default"><img src="../function/barcode.php?barcode=<?php echo $_POST['productname'].'&width=275&height=80';?>" /></li>
<?php 
	}
}
?>
</ol>

</div>

</body>
</html>
